package com.grm.workflow.controller;

import com.grm.common.entity.PageResult;
import com.grm.common.entity.Result;
import com.grm.workflow.request.my.request.WfMyRequestQueryParam;
import com.grm.workflow.response.WfMyRequestResponse;
import com.grm.workflow.service.WfMyRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/workflow/my/request")
public class WfMyRequestController {
    @Autowired
    private WfMyRequestService wfMyRequestService;

    @PostMapping("/list")
    public Result querySelective(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestBody WfMyRequestQueryParam queryParam) {
        // 开启分页
        PageResult<WfMyRequestResponse> pageResult = wfMyRequestService.querySelective(pageNum,pageSize,queryParam);
        return Result.success(pageResult.getData(),pageResult.getTotal());
    }
}
